<template>
  <div>
    <div class="weekend-title">
      周末去哪儿玩
    </div>
    <ul>
      <li class="item border-bottom" v-for="(item,index) in weekendList" :key="index">
        <div class="item-img-wrapper">
          <img class="item-img" :src="item.imgUrl" />
        </div>
        <div class="item-info">
          <div class="item-title">{{item.title}}</div>
          <div class="item-desc">{{item.desc}}</div>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'HomeWeekend',
  props: {
    weekendList: Array
  },
  computed: {
    showWeekendList () {
      return this.weekendList.length
    }
  }
}
</script>

<style lang="stylus" scoped>
  @import '~styles/mixins.styl';
  .weekend-title
    padding-top: .2rem
    padding-bottom: .2rem
    line-height: .4rem
    height: .4rem
    background: #fff
    text-indent: .2rem
  .item-img-wrapper
    height: 0
    overflow: hidden
    padding-bottom: 33.9%
  .item-info
    flex: 1
    min-width: 0 // 避免出现不了省略号
    padding: .1rem
    .item-title
      line-height: .54rem
      font-size: .32rem
      ellipsis()
    .item-desc
      line-height: .4rem
      color: #616161
      padding-right: .6rem
      font-size: .24rem
      ellipsis()
</style>
